package com.files.convert;

import com.files.model.FileInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.File;
@Service
@Slf4j
public class FileToFileInfoConverter implements CommonConverter<File, FileInfo> {
    @Override
    public FileInfo convert(File file) {
        FileInfo fileInfo=new FileInfo();
        fileInfo.setFile(file);
        fileInfo.setOriginalFilename(file.getName());
        return fileInfo;
    }
}
